import 'dart:async';

import 'package:base_lib/common/bloc/base_bloc.dart';
import 'package:doctor_login_lib/cache/userinfo_cache.dart';
import 'package:doctor_login_lib/login/entity/doctor_login_entity.dart'
    as LoginBean;

class MineBloc extends BaseBloc {
  @override
  void dispose() {
    userInfoStream?.close();
  }

  LoginBean.DoctorUser userInfo;

  StreamController<LoginBean.DoctorUser> userInfoStream =
      StreamController.broadcast();

  @override
  void initState() async {
    super.initState();
    UserInfoCache.getInstance().get().then((value) {
      userInfo = value;
      userInfoStream.add(userInfo);
    });
  }
}
